<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/connopen.asp"-->
<!--#include file="lib/asp-common-lib.asp"-->
<%

' if not cf(session("aaPostflag"),1) then call ShowError(2)

'获取提交查询的参数
companyid=SafeRequest("companyid",0)

' sql="select substr(cd.cd_no,1,18) as cd_no,cd_date,change,country,port,source,vessel,voyage,cd_box,cd_goods from (select cd_no,cd_date,cd_changeid,cd_countryid,cd_portid,cd_sourceid,cd_voyageid,cd_box from cd where cd_companyid="&companyid&") as cd,(select voyage.id as voyageid,vesselid,vessel,voyage from voyage,vessel where voyage.vesselid=vessel.id) as vv,cdc,change,source,port,country where cd.cd_no=cdc.cd_no and cd_changeid=change.id and cd_sourceid=source.id and cd_countryid=country.id and cd_portid=port.id and cd_voyageid=vv.voyageid order by cd_box desc"

sql="select substr(cd.cd_no,1,18) as cd_no,cd_date,change,country,port,source,vessel,voyage,cd_box,cd_goods from cd,voyage,vessel,cdc,change,source,port,country where cd_companyid="&companyid&" and cd.cd_no=cdc.cd_no and cd_changeid=change.id and cd_sourceid=source.id and cd_countryid=country.id and cd_portid=port.id and cd_voyageid=voyage.id and voyage.vesselid=vessel.id order by cd_box desc"

'组合sql查询字符串
'sql="select * from cdfee where true "
' sql="select "
' sql=sql&" * from rpt_cc where  "
' if ymid<>"" then sql=sql&" ymid="&ymid
' if countryid<>0 then sql=sql&" and countryid="&countryid

' sql=sql&" order by boxs desc limit 1000"
' response.write sql
' response.end
'执行数据查询
set rs = Server.CreateObject("ADODB.Recordset")
rs.cursorlocation=3
rs.open sql,conn,1,1
If rs.eof Then
	response.write("没有检索到数据!")
	response.end
End if

%>
<table class="full">
	<thead>
		<tr>
			<th scope="col">序号</th>
			<th scope="col">报关单号</th>
			<th scope="col">船名/航次</th>
			<th scope="col">报关日期</th>
			<th scope="col">交易</th>
			<th scope="col">国家</th>
			<th scope="col">港口</th>
			<th scope="col">货源</th>
			<th scope="col">箱量</th>
			<th scope="col">货物</th>
		</tr>
	</thead>
	<tbody>
<%
	do while not rs.eof
%>
		<tr>
			<th class="tac"><%=rs.AbsolutePosition%></th>
			<td><a href="http://www.nbedi.com/h2000eport_ic/pre_bgd/EntryLogDataSearch/bgd_print/normal_print.asp?pre_entry_id=<%=rs("cd_no")%>" target="_blank"><%=rs("cd_no")%></a></td>
			<td><%=rs("vessel")%>/<%=rs("voyage")%></td>
			<td><%=rs("cd_date")%></td>
			<td class="tac"><%=rs("change")%></td>
			<td><%=rs("country")%></td>
			<td><%=rs("port")%></td>
			<td><%=rs("source")%></td>
			<th class="tac"><%=rs("cd_box")%></th>
			<td title="<%=rs("cd_goods")%>"><%=left(rs("cd_goods"),20)%></td>
		</tr>
<%
		rs.movenext()
	loop
rs.close
Set rs=nothing
%>
	</tbody>
</table>

<!--#include file="lib/connclose.asp"-->

